package StudyCode.summary;

import java.io.File;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DeleteNonDirectory {
	public static void main(String[] arg) {
		File f = new File("E:\\Copy\\1");
		deleteFile(f);
	}

	private static void deleteFile(File dir) {
		File[] files = dir.listFiles();
		for (File f : files) {
			if (f.isDirectory()) {
				deleteFile(f);
			} else {
				System.out.println("删除成功?" + f.delete());
			}
		}
		System.out.println("删除成功?" + dir.delete());
	}
}
